package table

import (
	"gopkg.in/guregu/null.v4"
)

//City table:City Engine: InnoDB Collation: utf8mb4_general_ci
type City struct {
	//Id field:id int; unique index:PRIMARY;
	Id int
	//Name field:name varchar(40);
	Name string
	//ParentId field:parentId int;
	ParentId null.Int
	//Longitude field:longitude float;
	Longitude float32
	//Latitude field:latitude float;
	Latitude float32
	//Country field:country char(2);
	Country string
	//Level field:level int;1：省，2：市（地级市），3：县，4：乡
	Level int
}

//Graph table:Graph Engine: InnoDB Collation: utf8mb4_general_ci
type Graph struct {
	//Id field:id int; unique index:PRIMARY;
	Id int
	//Name field:name varchar(200);
	Name string
	//Ct field:ct bigint;
	Ct int64
	//Props field:props json;
	Props string
	//Creator field:creator int;
	Creator int
}

//GraphElement table:GraphElement Engine: InnoDB Collation: utf8mb4_general_ci
type GraphElement struct {
	//Id field:id int; unique index:PRIMARY;
	Id int
	//Name field:name varchar(200);
	Name string
	//Type field:type int;
	Type int
	//Ct field:ct bigint;
	Ct int64
	//ProtoId field:protoId int; normal index:gnpid; fk:gnpid ref:GraphElementProto.id
	ProtoId int
	//GraphId field:graphId int; normal index:gngid; fk:gngid ref:Graph.id
	GraphId int
	//Props field:props json;
	Props string
}

//GraphElementData table:GraphElementData Engine: InnoDB Collation: utf8mb4_general_ci
type GraphElementData struct {
	//Id field:id int; unique index:PRIMARY;
	Id int
	//ElementId field:elementId int; normal index:gedpeid; fk:gedpeid ref:GraphElement.id
	ElementId int
	//ProtoId field:protoId int; normal index:gedppid; fk:gedppid ref:GraphElementProto.id
	ProtoId int
	//Ct field:ct bigint;
	Ct int64
	//Power field:power json;
	Power string
	//Market field:market json;
	Market string
}

//GraphElementEdge table:GraphElementEdge Engine: InnoDB Collation: utf8mb4_general_ci
type GraphElementEdge struct {
	//Id field:id int; unique index:PRIMARY;
	Id int
	//ElementId field:elementId int; normal index:geeeid; fk:geeeid ref:GraphElement.id
	ElementId int
	//From field:from int; normal index:geefid; fk:geefid ref:GraphElement.id
	From int
	//To field:to int; normal index:geetid; fk:geetid ref:GraphElement.id
	To int
	//Ct field:ct bigint;
	Ct int64
}

//GraphElementProto table:GraphElementProto Engine: InnoDB Collation: utf8mb4_general_ci
type GraphElementProto struct {
	//Id field:id int; unique index:PRIMARY;
	Id int
	//Ct field:ct bigint;
	Ct int64
	//ClassId field:classId int; normal index:gecid; fk:gecid ref:GraphElementProtoClass.id
	ClassId int
	//Props field:props json;
	Props string
	//Name field:name varchar(200);
	Name string
	//No field:no int;
	No int
	//Type field:type int;
	Type int
	//Icon field:icon varchar(200);
	Icon string
	//Uid field:uid int; normal index:gepuid; fk:gepuid ref:User.id
	Uid int
}

//GraphElementProtoClass table:GraphElementProtoClass Engine: InnoDB Collation: utf8mb4_general_ci
type GraphElementProtoClass struct {
	//Id field:id int; unique index:PRIMARY;
	Id int
	//Ct field:ct bigint;
	Ct int64
	//Name field:name varchar(255);
	Name string
	//No field:no int;
	No int
	//Uid field:uid int; normal index:gepcuid; fk:gepcuid ref:User.id
	Uid int
}

//GraphElementProtoField table:GraphElementProtoField Engine: InnoDB Collation: utf8mb4_general_ci
type GraphElementProtoField struct {
	//Id field:id int; unique index:PRIMARY;
	Id int
	//ProtoId field:protoId int; normal index:gepfpid; fk:gepfpid ref:GraphElementProto.id
	ProtoId int
	//Field field:field varchar(50);data or market field to GraphElement
	Field string
	//Key field:key varchar(50);
	Key string
	//Type field:type varchar(10);string,int,float,select,multiselect
	Type string
	//Verify field:verify json;
	Verify string
	//Hint field:hint varchar(0);
	Hint string
	//Data field:data json;
	Data string
	//Ct field:ct bigint;
	Ct int64
}

//GraphElementUI table:GraphElementUI Engine: InnoDB Collation: utf8mb4_general_ci
type GraphElementUI struct {
	//Id field:id int; unique index:PRIMARY;
	Id int
	//Ct field:ct bigint;
	Ct int64
	//Json field:json json;
	Json string
	//ProtoId field:protoId int; normal index:geupid; fk:geupid ref:GraphElementProto.id
	ProtoId int
	//ElementId field:elementId int; normal index:geueid; fk:geueid ref:GraphElement.id
	ElementId int
}

//GraphField table:GraphField Engine: InnoDB Collation: utf8mb4_general_ci
type GraphField struct {
	//Id field:id int; unique index:PRIMARY;
	Id int
	//GraphId field:graphId int; unique index:gfuid; fk:gfgid ref:Graph.id
	GraphId int
	//ProtoId field:protoId int; unique index:gfuid normal index:gfpid; fk:gfpid ref:GraphElementProto.id
	ProtoId int
	//FieldId field:fieldId int; unique index:gfuid normal index:gffid; fk:gffid ref:GraphElementProtoField.id
	FieldId int
	//Ct field:ct bigint;
	Ct int64
}

//Project table:Project Engine: InnoDB Collation: utf8mb4_general_ci
type Project struct {
	//Id field:id int; unique index:PRIMARY;
	Id int
	//Name field:name varchar(100);
	Name string
	//GraphId field:graphId int; normal index:pgraphId; fk:pgraphId ref:Graph.id设计图id
	GraphId int
	//State field:state int;项目状态
	State int
	//Uid field:uid int; normal index:puid; fk:puid ref:User.id创建者
	Uid int
	//Ct field:ct bigint;
	Ct int64
	//MapCountry field:mapCountry varchar(2);地图国家，cn:中国
	MapCountry string
	//BidDate field:bidDate datetime;招标日期
	BidDate null.Time
	//Manager field:manager varchar(30);负责人
	Manager null.String
	//ManagerPhone field:managerPhone varchar(20);负责人电话
	ManagerPhone null.String
	//CompletionDate field:completionDate datetime;竣工日期
	CompletionDate null.Time
	//StaffNum field:staffNum int;人员规模
	StaffNum null.Int
	//ProjectType field:projectType int;项目类型
	ProjectType null.Int
	//ProjectAddr field:projectAddr varchar(200);项目地址
	ProjectAddr null.String
	//Remark field:remark varchar(300);备注
	Remark null.String
}

//ProjectUser table:ProjectUser Engine: InnoDB Collation: utf8mb4_general_ci
type ProjectUser struct {
	//Id field:id int; unique index:PRIMARY;
	Id int
	//Uid field:uid int; unique index:guuni normal index:guuid; fk:guuid ref:User.id
	Uid int
	//ProjectId field:projectId int; unique index:guuni normal index:gupid; fk:gugid ref:Project.id
	ProjectId int
	//Ct field:ct bigint;
	Ct int64
	//Role field:role int;
	Role int
}

//User table:User Engine: InnoDB Collation: utf8mb4_general_ci
type User struct {
	//Id field:id int; unique index:PRIMARY;
	Id int
	//Ct field:ct bigint;
	Ct int64
	//Name field:name varchar(30);
	Name string
	//Role field:role int;1:admin,2:user
	Role int
}

//UserPrivate table:UserPrivate Engine: InnoDB Collation: utf8mb4_general_ci
type UserPrivate struct {
	//Id field:id int; unique index:PRIMARY;
	Id int
	//Uid field:uid int; unique index:upuid; fk:upuid ref:User.id
	Uid int
	//Password field:password varchar(32);
	Password string
	//Email field:email varchar(100);
	Email string
	//Mobile field:mobile varchar(20);
	Mobile string
	//Ct field:ct bigint;
	Ct int64
}

